\(\int \frac {x (1+x)^2}{(1+x+x^2)^3} \, dx\) [2405]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 15, antiderivative size = 33 \[ \int \frac {x (1+x)^2}{\left (1+x+x^2\right )^3} \, dx=-\frac {(1+x) (1+2 x)}{6 \left (1+x+x^2\right )^2}-\frac {1}{6 \left (1+x+x^2\right )} \]

[Out]

-1/6*(1+x)*(1+2*x)/(x^2+x+1)^2-1/6/(x^2+x+1)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {832, 643} \[ \int \frac {x (1+x)^2}{\left (1+x+x^2\right )^3} \, dx=-\frac {(x+1) (2 x+1)}{6 \left (x^2+x+1\right )^2}-\frac {1}{6 \left (x^2+x+1\right )} \]

[In]

Int[(x*(1 + x)^2)/(1 + x + x^2)^3,x]

[Out]

-1/6*((1 + x)*(1 + 2*x))/(1 + x + x^2)^2 - 1/(6*(1 + x + x^2))

Rule 643

Int[((d_) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[d*((a + b*x + c*x^2)^(p +
 1)/(b*(p + 1))), x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[2*c*d - b*e, 0] && NeQ[p, -1]

Rule 832

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Sim
p[(-(d + e*x)^(m - 1))*(a + b*x + c*x^2)^(p + 1)*((2*a*c*(e*f + d*g) - b*(c*d*f + a*e*g) - (2*c^2*d*f + b^2*e*
g - c*(b*e*f + b*d*g + 2*a*e*g))*x)/(c*(p + 1)*(b^2 - 4*a*c))), x] - Dist[1/(c*(p + 1)*(b^2 - 4*a*c)), Int[(d
+ e*x)^(m - 2)*(a + b*x + c*x^2)^(p + 1)*Simp[2*c^2*d^2*f*(2*p + 3) + b*e*g*(a*e*(m - 1) + b*d*(p + 2)) - c*(2
*a*e*(e*f*(m - 1) + d*g*m) + b*d*(d*g*(2*p + 3) - e*f*(m - 2*p - 4))) + e*(b^2*e*g*(m + p + 1) + 2*c^2*d*f*(m
+ 2*p + 2) - c*(2*a*e*g*m + b*(e*f + d*g)*(m + 2*p + 2)))*x, x], x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] &&
NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && LtQ[p, -1] && GtQ[m, 1] && ((EqQ[m, 2] && EqQ[p, -3] &
& RationalQ[a, b, c, d, e, f, g]) ||  !ILtQ[m + 2*p + 3, 0])

Rubi steps \begin{align*} \text {integral}& = -\frac {(1+x) (1+2 x)}{6 \left (1+x+x^2\right )^2}-\frac {1}{6} \int \frac {-1-2 x}{\left (1+x+x^2\right )^2} \, dx \\ & = -\frac {(1+x) (1+2 x)}{6 \left (1+x+x^2\right )^2}-\frac {1}{6 \left (1+x+x^2\right )} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.67 \[ \int \frac {x (1+x)^2}{\left (1+x+x^2\right )^3} \, dx=-\frac {2+4 x+3 x^2}{6 \left (1+x+x^2\right )^2} \]

[In]

Integrate[(x*(1 + x)^2)/(1 + x + x^2)^3,x]

[Out]

-1/6*(2 + 4*x + 3*x^2)/(1 + x + x^2)^2

Maple [A] (verified)

Time = 0.38 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.61

method result size
default \(\frac {-\frac {1}{2} x^{2}-\frac {2}{3} x -\frac {1}{3}}{\left (x^{2}+x +1\right )^{2}}\) \(20\)
norman \(\frac {-\frac {1}{2} x^{2}-\frac {2}{3} x -\frac {1}{3}}{\left (x^{2}+x +1\right )^{2}}\) \(20\)
risch \(\frac {-\frac {1}{2} x^{2}-\frac {2}{3} x -\frac {1}{3}}{\left (x^{2}+x +1\right )^{2}}\) \(20\)
gosper \(-\frac {3 x^{2}+4 x +2}{6 \left (x^{2}+x +1\right )^{2}}\) \(21\)
parallelrisch \(\frac {-3 x^{2}-4 x -2}{6 \left (x^{2}+x +1\right )^{2}}\) \(21\)

[In]

int(x*(1+x)^2/(x^2+x+1)^3,x,method=_RETURNVERBOSE)

[Out]

1/(x^2+x+1)^2*(-1/2*x^2-2/3*x-1/3)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.97 \[ \int \frac {x (1+x)^2}{\left (1+x+x^2\right )^3} \, dx=-\frac {3 \, x^{2} + 4 \, x + 2}{6 \, {\left (x^{4} + 2 \, x^{3} + 3 \, x^{2} + 2 \, x + 1\right )}} \]

[In]

integrate(x*(1+x)^2/(x^2+x+1)^3,x, algorithm="fricas")

[Out]

-1/6*(3*x^2 + 4*x + 2)/(x^4 + 2*x^3 + 3*x^2 + 2*x + 1)

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.94 \[ \int \frac {x (1+x)^2}{\left (1+x+x^2\right )^3} \, dx=\frac {- 3 x^{2} - 4 x - 2}{6 x^{4} + 12 x^{3} + 18 x^{2} + 12 x + 6} \]

[In]

integrate(x*(1+x)**2/(x**2+x+1)**3,x)

[Out]

(-3*x**2 - 4*x - 2)/(6*x**4 + 12*x**3 + 18*x**2 + 12*x + 6)

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.97 \[ \int \frac {x (1+x)^2}{\left (1+x+x^2\right )^3} \, dx=-\frac {3 \, x^{2} + 4 \, x + 2}{6 \, {\left (x^{4} + 2 \, x^{3} + 3 \, x^{2} + 2 \, x + 1\right )}} \]

[In]

integrate(x*(1+x)^2/(x^2+x+1)^3,x, algorithm="maxima")

[Out]

-1/6*(3*x^2 + 4*x + 2)/(x^4 + 2*x^3 + 3*x^2 + 2*x + 1)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.61 \[ \int \frac {x (1+x)^2}{\left (1+x+x^2\right )^3} \, dx=-\frac {3 \, x^{2} + 4 \, x + 2}{6 \, {\left (x^{2} + x + 1\right )}^{2}} \]

[In]

integrate(x*(1+x)^2/(x^2+x+1)^3,x, algorithm="giac")

[Out]

-1/6*(3*x^2 + 4*x + 2)/(x^2 + x + 1)^2

Mupad [B] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.61 \[ \int \frac {x (1+x)^2}{\left (1+x+x^2\right )^3} \, dx=-\frac {3\,x^2+4\,x+2}{6\,{\left (x^2+x+1\right )}^2} \]

[In]

int((x*(x + 1)^2)/(x + x^2 + 1)^3,x)

[Out]

-(4*x + 3*x^2 + 2)/(6*(x + x^2 + 1)^2)